package genhandle

import (
	"fginTpl/fgin_grpc_gen/config"
	"fginTpl/fgin_grpc_gen/globals"
	"fginTpl/utils"
	"path/filepath"
)

// 生成插件文件
func GenInitPlugs() {
	tplParams := map[string]string{
		"ProjectName": config.ConfigData.ProjectName,
		"Port":        config.ConfigData.Port,
	}
	// 生成plugs.go文件
	if err := utils.TourchFile(filepath.Join(globals.BASEDIR, "./init_plugs/init_plugs.go"), "./fgin_grpc_templates/init_plugs/init_plugs.tpl", "initPlugsGoTpl", tplParams); err != nil {
		panic(err)
	}
}
